Research questions:

Section 1 - Table 1 - [ ] For each LGA , which police region recorded maximum incidents? - [ ] How did the trend of incidents recorded in those police regions varied across the years.

Section 2

Section 3

What are the top 10 Suburb’s recorded with most number of incidents in each Year ?

data3 %>% 
  group_by(Year,Suburb) %>%
  summarise(Total_Incidents = sum(Incidents_Recorded)) %>% 
  arrange(Year,desc(Total_Incidents)) %>% 
  slice_max(Total_Incidents,n = 10) %>% 
  mutate(Suburb1 = reorder_within(Suburb,Total_Incidents,Year)) %>% 
  ggplot(aes(x=Total_Incidents ,
             y=Suburb1,
             fill = Suburb)) +
  geom_col() +
  geom_text(aes(label = Total_Incidents)) +
  scale_y_reordered() +
  ylab("Suburb") +
  xlab("No. of Incidents") +
  ggtitle("Top 10 Suburb with most incidents recorded in each Years") +
  facet_wrap(~Year,ncol = 1, scales = "free")
Top 10 Suburb with most incidents recorded

Top 10 Suburb with most incidents recorded

What were the top 10 Offence’s in each year ?

Top 10 Offences recorded

Top 10 Offences recorded

What are the top 2 Offences for the most common Suburb found in Q1?

Top 10 Offfences Suburrb wise

What is the trend of top 2 offences in each year w.r.t Suburb?

Q4graoh <- data3 %>% 
  filter(Suburb %in% unique(Suburb_imp$Suburb)) %>% 
  group_by(Year,Suburb,Offence_Subdivision) %>% 
  summarise(Tot_incidents = sum(Incidents_Recorded)) %>% 
  slice_max(Tot_incidents,n = 2) %>% 
  ggplot(aes(x= as.numeric(Year),
             y =Tot_incidents,
             color = Offence_Subdivision)) +
  geom_line() +
  geom_point() +
  scale_x_continuous() +
  xlab("Year") +
  ylab("Total_incidents") +
  facet_wrap(~Suburb)
ggplotly(Q4graoh)